package com.java110.mall.goods.bmo.housekeepingResource.impl;

import com.java110.core.annotation.Java110Transactional;

import com.java110.mall.goods.bmo.housekeepingResource.IUpdateHousekeepingResourceBMO;
import com.java110.intf.cart.IHousekeepingFeeConfigInnerServiceSMO;
import com.java110.intf.goods.IHousekeepingResourceInnerServiceSMO;
import com.java110.po.housekeeping.HousekeepingFeeConfigPo;
import com.java110.po.housekeeping.HousekeepingResourcePo;
import com.java110.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

@Service("updateHousekeepingResourceBMOImpl")
public class UpdateHousekeepingResourceBMOImpl implements IUpdateHousekeepingResourceBMO {

    @Autowired
    private IHousekeepingResourceInnerServiceSMO housekeepingResourceInnerServiceSMOImpl;
    @Autowired
    private IHousekeepingFeeConfigInnerServiceSMO housekeepingFeeConfigInnerServiceSMOImpl;
    /**
     *
     *
     * @param housekeepingResourcePo
     * @return 订单服务能够接受的报文
     */
    @Java110Transactional
    public ResponseEntity<String> update(HousekeepingResourcePo housekeepingResourcePo, HousekeepingFeeConfigPo housekeepingFeeConfigPo) {

        int flag = housekeepingResourceInnerServiceSMOImpl.updateHousekeepingResource(housekeepingResourcePo);

        if (flag < 1) {
        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "修改失败");
        }
        int cflag = housekeepingFeeConfigInnerServiceSMOImpl.updateHousekeepingFeeConfig(housekeepingFeeConfigPo);

        if (cflag < 1) {
            return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "修改失败");
        }
        return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
    }

}
